/**
 * Defines the methods of the sorted list ADT.
 */
public interface SortedList<T extends Comparable<? super T>> {

	/**
	 * Adds an element to the list.
	 * 
	 * @param element
	 *            The new element
	 */
	public void add(T element);

	/**
	 * Removes an element from the list, if it exists.
	 * 
	 * @param element
	 *            The element to remove
	 * @return The element that was removed, or null if the element was not in
	 *         the list
	 */
	public T remove(T element);

	/**
	 * Returns, but does not remove, the smallest element in the list.
	 * 
	 * @return The smallest element in the list
	 */
	public T getMin();

	/**
	 * Returns, but does not remove, the largest element in the list.
	 * 
	 * @return The largest element in the list
	 */
	public T getMax();

	/**
	 * Returns the index of an element in the list.
	 * 
	 * @param element
	 *            The element to look for
	 * @return The index of the element, if it is contained in the list;
	 *         otherwise, (-(insertion point) - 1). The insertion point is
	 *         defined as the point at which the element would be inserted into
	 *         the list
	 */
	public int indexOf(T element);

	/**
	 * Determines if an element is in the list.
	 * 
	 * @param element
	 *            The element to search for
	 * @return true if the element is in the list, or false otherwise
	 */
	public boolean contains(T element);

	/**
	 * Removes all elements from the list.
	 */
	public void clear();

	/**
	 * Returns the number of elements in the list.
	 * 
	 * @return The size of the list
	 */
	public int size();

	/**
	 * Determines if the list is empty.
	 * 
	 * @return true if the list is empty, or false otherwise
	 */
	public boolean isEmpty();
}
